package com.chen.service.impl;

import com.chen.dao.TypeMapper;
import com.chen.pojo.Article;
import com.chen.pojo.Type;
import com.chen.service.TypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class TypeServiceImpl implements TypeService {

    //组合mapper
    private TypeMapper typeMapper;

    //set注入
    public void setTypeMapper(TypeMapper typeMapper) {
        this.typeMapper = typeMapper;
    }

    public List<Type> allType() {
        return typeMapper.allType();
    }

    public int addType(Type type) {
        return typeMapper.addType(type);
    }

    public int deleteType(int id) {
        return typeMapper.deleteType(id);
    }

    public List<Article> getByType(int id) {
        return typeMapper.getByType(id);
    }

    @Override
    public Type getTypeByArcId(int arcId) {
        return typeMapper.getTypeByArcId(arcId);
    }
}
